package org.sanm.domain.goods;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.sanm.common.BaseEntity;
import org.sanm.domain.category.Category;
import org.sanm.domain.company.Company;

@Data
@TableName(autoResultMap = true)
public class Goods extends BaseEntity {
    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;

    private Integer companyId;

    private Long price;

    private String unit;

    private Integer categoryId;

    @TableField(exist = false)
    @Schema(hidden = true)
    private Company company = new Company();
    @TableField(exist = false)
    @Schema(hidden = true)
    private Category category = new Category();
    @TableField(exist = false)
    @Schema(hidden = true)
    private Integer num;
}
